package com.dm.cloud.images.mode;

import com.github.dockerjava.api.model.Network;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.util.HashMap;
import java.util.Map;

@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description ="创建Docker网络模型")
@Data
public class NetworkCreatMode {
    @Schema(description = "节点标识,不能为空")
    private String endpointId;
    /**
     * 标签列表
     */
    @Schema(description = "网络标签列表")
    private Map<String,String> labels=new HashMap<>();

    /**
     * ipam配置
     */
    @Schema(description = "IP相关配置")
    private Network.Ipam ipam;

    @Schema(description = "这个网络是否可以被其它容器使用，默认true.false的其它容器用不了，默认true")
    private Boolean attachable=true;

    @Schema(description = "是否重复检查，默认true,前端固定填写true")
    private Boolean checkDuplicate;

    @Schema(description = "驱动类型:bridge、host、none,默认 bridge")
    private String driver;

    @Schema(description = "限制外部访问网络,默认false")
    private Boolean internal;

    @Schema(description = "打开ipV6配置，前端暂时不用")
    private Boolean enableIpv6;

    @Schema(description = "网络名称，必填")
    @NotNull
    private String name;

    @Schema(description = "网络配置项")
    private Map<String,String> opt=new HashMap<>();

}
